package com.sharemarking.wa.platform.dto.receiveOrderDriver;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sharemarking.wa.common.eum.OrderOperateTypeEum;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author dxy
 */
public class OrderInfoDto {
    private String loadingAddress;
    private String unLoadingAddress;
    private String transferTime;
    private String carRequirement;
    private String orgName;
    private String contact;
    private String mobile;
    private Integer isUrgent;
    private String notes;
    private Date createDate;
    private String code;
    private Integer distance;
    private Integer transportFees;
    private Integer payer;
    private String transportOrgName;
    private String driverName;
    private String driverMobile;
    private Integer carNumber;
    private Integer state;
    List<OrderOperateTypeEum> operate;
    private String wasteOrgName;
    private String wasteContact;
    private String wasteMobile;

    @JsonIgnore
    private Date transferStart;
    @JsonIgnore
    private Date transferEnd;

    public String getLoadingAddress() {
        return loadingAddress;
    }

    public void setLoadingAddress(String loadingAddress) {
        this.loadingAddress = loadingAddress;
    }

    public String getUnLoadingAddress() {
        return unLoadingAddress;
    }

    public void setUnLoadingAddress(String unLoadingAddress) {
        this.unLoadingAddress = unLoadingAddress;
    }

    public String getTransferTime() {
        if (transferEnd!=null && transferStart!=null){
            SimpleDateFormat sf = new SimpleDateFormat("yyyy.MM.dd");
            String start = sf.format(transferStart);
            String end = sf.format(transferEnd);
            String transfer = start + "-" +end;
            return transfer;
        }
        return null;
    }

    public void setTransferTime(String transferTime) {
        this.transferTime = transferTime;
    }

    public String getCarRequirement() {
        return carRequirement;
    }

    public void setCarRequirement(String carRequirement) {
        this.carRequirement = carRequirement;
    }

    public String getOrgName() {
        return orgName;
    }

    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getIsUrgent() {
        return isUrgent;
    }

    public void setIsUrgent(Integer isUrgent) {
        this.isUrgent = isUrgent;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getDistance() {
        return distance;
    }

    public void setDistance(Integer distance) {
        this.distance = distance;
    }

    public Integer getTransportFees() {
        return transportFees;
    }

    public void setTransportFees(Integer transportFees) {
        this.transportFees = transportFees;
    }

    public Integer getPayer() {
        return payer;
    }

    public void setPayer(Integer payer) {
        this.payer = payer;
    }

    public String getTransportOrgName() {
        return transportOrgName;
    }

    public void setTransportOrgName(String transportOrgName) {
        this.transportOrgName = transportOrgName;
    }

    public String getDriverName() {
        return driverName;
    }

    public void setDriverName(String driverName) {
        this.driverName = driverName;
    }

    public String getDriverMobile() {
        return driverMobile;
    }

    public void setDriverMobile(String driverMobile) {
        this.driverMobile = driverMobile;
    }

    public Integer getCarNumber() {
        return carNumber;
    }

    public void setCarNumber(Integer carNumber) {
        this.carNumber = carNumber;
    }

    public Integer getState() {
        if (state!=null){
            return state - 6;
        }
        return null;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public List<OrderOperateTypeEum> getOperate() {
        return operate;
    }

    public void setOperate(List<OrderOperateTypeEum> operate) {
        this.operate = operate;
    }

    public Date getTransferStart() {
        return transferStart;
    }

    public void setTransferStart(Date transferStart) {
        this.transferStart = transferStart;
    }

    public Date getTransferEnd() {
        return transferEnd;
    }

    public void setTransferEnd(Date transferEnd) {
        this.transferEnd = transferEnd;
    }

    public String getWasteOrgName() {
        return wasteOrgName;
    }

    public void setWasteOrgName(String wasteOrgName) {
        this.wasteOrgName = wasteOrgName;
    }

    public String getWasteContact() {
        return wasteContact;
    }

    public void setWasteContact(String wasteContact) {
        this.wasteContact = wasteContact;
    }

    public String getWasteMobile() {
        return wasteMobile;
    }

    public void setWasteMobile(String wasteMobile) {
        this.wasteMobile = wasteMobile;
    }
}
